/*
 * @Author: Gavin
 * @Date: 2018-09-10 13:00:50
 * @LastEditors: Gavin
 * @LastEditTime: 2018-09-10 13:50:11
 * @Description:
 */
import { h, Component } from 'preact'
import { Provider } from 'unistore/preact'

import Router from './components/Router.js'
import routes from './router/main.js'

import List from './components/List.js'
import Header from './components/Header/index.js'
import Drawer from './components/Drawer/index.js'

export default class App extends Component {
    render({ url, store }) {
        return (
            <Provider store={store} >
                <div id="root" class="root">
                    <Drawer>
                        <List routes={routes()} />
                    </Drawer>
                    <main class="main">
                        <Header />
                        <div class="content">
                            <Router url={url} routes={routes()} />
                        </div>
                    </main>
                </div>
            </Provider>
        )
    }
}
